import { UPDATA_SYSTEM } from '../actionTypes'
import Ajax from 'lib/Ajax'
import { message } from 'antd'

const INITCONFIG = {}

export function updataSystem(b){
  if(b){
    return {
      type: "NULL_SYSTEM"
    }
  }else{
    return dispatch => {
      Ajax({
        url: '/common/data',
        data: {},
        success: function(data){
          dispatch(updata(data));
        },
        error: function(error){
          message.error(error);
        }
      });
    }
  }
}

export function updata(data) {
  return {
          type: UPDATA_SYSTEM,
          data
        }
}